//一个普通的例子
const origin = {
    name: '李狗蛋'
}
const obj = new Proxy(origin, {
    /**
     * 
     * @param {*} target 目标对象
     * @param {*} propKey 属性名
     * @param {*} receiver Proxy实例本身
     */
    get(target, propKey, receiver) {
        if (propKey in target) {
            return target[propKey]
        } else {
            throw new ReferenceError(`${target}上不存在${propKey}属性`)
        }
    }
})

console.log(obj.name);
console.log(obj.age);